package data{
	import flash.display.MovieClip;

	public class Tower{
		public var type:TowerType;
		public var px:Number;
		public var py:Number;
		private var mc:MovieClip;
		public function Tower(_obj:Object){
			if(!_obj) return;
			mc = _obj.target;
			px = _obj.px;
			py = _obj.py;
			selectType();
		}
		
		private function selectType():void{
			switch(mc.name){
				case "Tower1":
					type = new Tower1();
					break;
				case "Tower2":
					type = new Tower2();
					break;
				case "Tower3":
					type = new Tower3();
					break;
				case "Tower4":
					type = new Tower4();
					break;
			}
		}
		
		/**
		 * 获取塔人攻击范围半径 
		 * @param _mc
		 * @return 
		 * 
		 */	
		public function getTowerR(_name:String):uint{
			var redian:uint;
			switch(_name){
				case "Tower1":
					redian =new Tower1().r;
					break;
				case "Tower2":
					redian =new Tower2().r;
					break;
				case "Tower3":
					redian =new Tower3().r;
					break;
				case "Tower4":
					redian =new Tower4().r;
					break;
			}
			return redian;
		}
		
	}
}